import org.jfugue.midi.MidiFileManager;
import org.jfugue.pattern.Pattern;

import java.io.File;
import java.io.IOException;

public class ExportMidi {
    public static void main(String[] args) throws IOException {
        Pattern right = new Pattern("T70 :CON(7,100) :CON(10,100) I[Piano] V0 " +  // 速度设为70 BPM（可改为60-80）
                // 第1-2行：四分与八分交替
                "C4q E4q G4q C5q B4q C5q G4q E4q " +
                "C4i E4i G4i C5i B4i C5i G4i E4i " +
                // 第3-4行：高音区交替
                "G4q C5q E5q G5q F5q E5q D5q C5q " +
                "G4i C5i E5i G5i F5i E5i D5i C5i");
        MidiFileManager.savePatternToMidi(right, new File("right.mid"));
    }
}
